package com.asm.server.service;


import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class UserServiceMemoryImpl implements UserService{
    private Map<String,String>allUserMap=new ConcurrentHashMap<>();
    {
     allUserMap.put("zhangsan","123");
     allUserMap.put("lishi","123");
     allUserMap.put("wangwu","123");
     allUserMap.put("zhaooliu","123");
     allUserMap.put("qianqi","123");
    }

    @Override
    public boolean login(String username,String password){
        String pass=allUserMap.get(username);
        if(pass==null){
            return false;
        }
        System.out.println(pass);
        return pass.equals(password);
    }
}
